package com.wysql.ascost.util;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.Color;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

/**
 * 基础管理提升导出工具类
 *
 * @author Administrator
 */
public class SystemExportTools {

    /**
     * 基础管理提升模板所在路径
     */
    public static final String TEMPLATE_PATH = "basicManagementTemplate/export/";


    /**
     * 表格样式-指标
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static Map<Integer, HSSFCellStyle> indexStyle(HSSFWorkbook hssfWorkbook, HSSFFont font) {
        HSSFDataFormat format = hssfWorkbook.createDataFormat();
        Map<Integer, HSSFCellStyle> styleMap = new HashMap<>();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        setBorder.setWrapText(true);
        styleMap.put(0, setBorder);
        HSSFCellStyle setDouble = hssfWorkbook.createCellStyle();
        setDouble.setAlignment(HorizontalAlignment.CENTER);
        setDouble.setVerticalAlignment(VerticalAlignment.CENTER);
        setDouble.setBorderBottom(BorderStyle.THIN);
        setDouble.setBorderLeft(BorderStyle.THIN);
        setDouble.setBorderTop(BorderStyle.THIN);
        setDouble.setBorderRight(BorderStyle.THIN);
        setDouble.setFont(font);
        setDouble.setWrapText(true);
        setDouble.setDataFormat(format.getFormat("#,##0.00"));
        styleMap.put(1, setDouble);
        return styleMap;
    }

    /**
     * 表格样式-基础管理提升
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static HSSFCellStyle style(HSSFWorkbook hssfWorkbook) {

        HSSFFont font = hssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();

        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        setBorder.setWrapText(true);
        return setBorder;
    }

    /**
     * 表格样式1 -任务管理
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static HSSFCellStyle style2(HSSFWorkbook hssfWorkbook, int styleCode, HSSFFont font, HSSFCellStyle setBorder) {

        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 16);

        setBorder.setWrapText(true);
        switch (styleCode) {
            case 0:
                setBorder.setAlignment(HorizontalAlignment.CENTER);
                setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
                setBorder.setBorderBottom(BorderStyle.THIN);
                setBorder.setBorderLeft(BorderStyle.THIN);
                setBorder.setBorderTop(BorderStyle.THIN);
                setBorder.setBorderRight(BorderStyle.THIN);
                setBorder.setFont(font);
                return setBorder;
            case 1:
                setBorder.setAlignment(HorizontalAlignment.LEFT);
                setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
                setBorder.setBorderBottom(BorderStyle.THIN);
                setBorder.setBorderLeft(BorderStyle.THIN);
                setBorder.setBorderTop(BorderStyle.THIN);
                setBorder.setBorderRight(BorderStyle.THIN);
                setBorder.setFont(font);
                return setBorder;
            default:

                return setBorder;
        }

    }


    /**
     * 表格样式1 -任务管理
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static Map<Integer, HSSFCellStyle> style2(HSSFWorkbook hssfWorkbook, HSSFFont font) {

        Map<Integer, HSSFCellStyle> map = new HashMap<>();

        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 16);
        setBorder.setWrapText(true);
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        map.put(0, setBorder);


        HSSFCellStyle setBorder2 = hssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 16);
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.LEFT);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        setBorder2.setFont(font);
        map.put(1, setBorder2);

        return map;
    }


    /**
     * 表格样式2 -任务管理
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static HSSFCellStyle style3(HSSFWorkbook hssfWorkbook) {
        HSSFFont font = hssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 16);
        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();
        return setBorder;
    }

    /**
     * 表格样式1 -机关作风
     *
     * @param hssfWorkbook -
     * @return -
     */
    public static Map<Integer, HSSFCellStyle> style4(HSSFWorkbook hssfWorkbook, HSSFFont font) {

        Map<Integer, HSSFCellStyle> map = new HashMap<>();

        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder.setWrapText(true);
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        map.put(0, setBorder);


        HSSFCellStyle setBorder2 = hssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.LEFT);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        setBorder2.setFont(font);
        map.put(1, setBorder2);

        HSSFCellStyle setBorder3 = hssfWorkbook.createCellStyle();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        HSSFDataFormat df3 = hssfWorkbook.createDataFormat();
        setBorder3.setDataFormat(df3.getFormat("0.00"));
        map.put(2, setBorder3);

        HSSFCellStyle setBorder4 = hssfWorkbook.createCellStyle();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        setBorder4.setWrapText(true);
        setBorder4.setAlignment(HorizontalAlignment.CENTER);
        setBorder4.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder4.setBorderBottom(BorderStyle.THIN);
        setBorder4.setBorderLeft(BorderStyle.THIN);
        setBorder4.setBorderTop(BorderStyle.THIN);
        setBorder4.setBorderRight(BorderStyle.THIN);
        setBorder4.setFont(font);
        map.put(3, setBorder4);
        return map;
    }

    /**
     * 表格样式1 -okr
     *
     * @param xssfWorkbook -
     * @return -
     */
    public static Map<Integer, XSSFCellStyle> styleOkr(XSSFWorkbook xssfWorkbook, XSSFFont font) {

        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 11);
        font.setBold(false);
        setBorder.setWrapText(true);
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        map.put(0, setBorder);


        XSSFCellStyle setBorder2 = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 11);
        font.setBold(false);
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.LEFT);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        setBorder2.setFont(font);
        map.put(1, setBorder2);

        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 11);
        font.setBold(false);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        map.put(2, setBorder3);

        return map;
    }

    public static Map<Integer, XSSFCellStyle> styleOkr2(XSSFWorkbook xssfWorkbook, XSSFFont font) {

        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 11);
        font.setBold(true);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        map.put(0, setBorder3);

        return map;
    }

    /**
     * 重点工作任务
     *
     * @param xssfWorkbook
     * @param font
     * @return
     */
    public static Map<Integer, XSSFCellStyle> style5(XSSFWorkbook xssfWorkbook, XSSFFont font) {

        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder.setWrapText(true);
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        map.put(0, setBorder);

        XSSFCellStyle setBorder2 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        font.setColor(new XSSFColor(Color.RED));
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.CENTER);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        setBorder2.setFont(font);
        map.put(1, setBorder2);


        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        setBorder3.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df = xssfWorkbook.createDataFormat();
        setBorder3.setDataFormat(df.getFormat("#,#0.0"));
        setBorder3.setFont(font);
        map.put(2, setBorder3);

        XSSFCellStyle setBorder4 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder4.setWrapText(true);
        setBorder4.setAlignment(HorizontalAlignment.CENTER);
        setBorder4.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder4.setBorderBottom(BorderStyle.THIN);
        setBorder4.setBorderLeft(BorderStyle.THIN);
        setBorder4.setBorderTop(BorderStyle.THIN);
        setBorder4.setBorderRight(BorderStyle.THIN);
        setBorder4.setFont(font);
        setBorder4.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder4.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df1 = xssfWorkbook.createDataFormat();
        setBorder4.setDataFormat(df1.getFormat("#,#0.0"));
        setBorder4.setFont(font);
        map.put(3, setBorder4);

        XSSFCellStyle setBorder5 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder5.setWrapText(true);
        setBorder5.setAlignment(HorizontalAlignment.CENTER);
        setBorder5.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder5.setBorderBottom(BorderStyle.THIN);
        setBorder5.setBorderLeft(BorderStyle.THIN);
        setBorder5.setBorderTop(BorderStyle.THIN);
        setBorder5.setBorderRight(BorderStyle.THIN);

        XSSFDataFormat df2 = xssfWorkbook.createDataFormat();
        setBorder5.setDataFormat(df2.getFormat("#,#0.0"));
        setBorder5.setFont(font);
        map.put(4, setBorder5);


        XSSFCellStyle setBorder6 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder6.setWrapText(true);
        setBorder6.setAlignment(HorizontalAlignment.CENTER);
        setBorder6.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder6.setBorderBottom(BorderStyle.THIN);
        setBorder6.setBorderLeft(BorderStyle.THIN);
        setBorder6.setBorderTop(BorderStyle.THIN);
        setBorder6.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df3 = xssfWorkbook.createDataFormat();
        setBorder6.setDataFormat(df3.getFormat("#,#0.00"));
        setBorder6.setFont(font);
        map.put(5, setBorder6);


        XSSFCellStyle setBorder7 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        font.setColor(new XSSFColor(Color.RED));
        setBorder7.setWrapText(true);
        setBorder7.setAlignment(HorizontalAlignment.CENTER);
        setBorder7.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder7.setBorderBottom(BorderStyle.THIN);
        setBorder7.setBorderLeft(BorderStyle.THIN);
        setBorder7.setBorderTop(BorderStyle.THIN);
        setBorder7.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df4 = xssfWorkbook.createDataFormat();
        setBorder7.setDataFormat(df4.getFormat("#,#0.00"));
        setBorder7.setFont(font);
        map.put(6, setBorder7);


        XSSFCellStyle setBorder8 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder8.setWrapText(true);
        setBorder8.setAlignment(HorizontalAlignment.CENTER);
        setBorder8.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder8.setBorderBottom(BorderStyle.THIN);
        setBorder8.setBorderLeft(BorderStyle.THIN);
        setBorder8.setBorderTop(BorderStyle.THIN);
        setBorder8.setBorderRight(BorderStyle.THIN);
        setBorder8.setFont(font);
        setBorder8.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder8.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df7 = xssfWorkbook.createDataFormat();
        setBorder8.setDataFormat(df7.getFormat("#,#0"));
        setBorder8.setFont(font);
        map.put(7, setBorder8);

        XSSFCellStyle setBorder9 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder9.setWrapText(true);
        setBorder9.setAlignment(HorizontalAlignment.CENTER);
        setBorder9.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder9.setBorderBottom(BorderStyle.THIN);
        setBorder9.setBorderLeft(BorderStyle.THIN);
        setBorder9.setBorderTop(BorderStyle.THIN);
        setBorder9.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df9 = xssfWorkbook.createDataFormat();
        setBorder9.setDataFormat(df9.getFormat("#,#0.000"));
        setBorder9.setFont(font);
        map.put(9, setBorder9);

        XSSFCellStyle setBorder10 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        font.setBold(true);
        setBorder10.setWrapText(true);
        setBorder10.setAlignment(HorizontalAlignment.CENTER);
        setBorder10.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder10.setBorderBottom(BorderStyle.THIN);
        setBorder10.setBorderLeft(BorderStyle.THIN);
        setBorder10.setBorderTop(BorderStyle.THIN);
        setBorder10.setBorderRight(BorderStyle.THIN);
        setBorder10.setFont(font);
        map.put(10, setBorder10);

        XSSFCellStyle setBorder11 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(false);
        setBorder11.setWrapText(true);
        setBorder11.setAlignment(HorizontalAlignment.CENTER);
        setBorder11.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder11.setBorderBottom(BorderStyle.THIN);
        setBorder11.setBorderLeft(BorderStyle.THIN);
        setBorder11.setBorderTop(BorderStyle.THIN);
        setBorder11.setBorderRight(BorderStyle.THIN);
        setBorder11.setFont(font);
        map.put(11, setBorder11);

        XSSFCellStyle setBorder12 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(false);
        setBorder12.setWrapText(true);
        setBorder12.setAlignment(HorizontalAlignment.LEFT);
        setBorder12.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder12.setBorderBottom(BorderStyle.THIN);
        setBorder12.setBorderLeft(BorderStyle.THIN);
        setBorder12.setBorderTop(BorderStyle.THIN);
        setBorder12.setBorderRight(BorderStyle.THIN);
        setBorder12.setFont(font);
        map.put(12, setBorder12);

        XSSFCellStyle setBorder13 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 48);
        font.setBold(true);
        setBorder13.setWrapText(true);
        setBorder13.setAlignment(HorizontalAlignment.LEFT);
        setBorder13.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder13.setBorderBottom(BorderStyle.THIN);
        setBorder13.setBorderLeft(BorderStyle.THIN);
        setBorder13.setBorderTop(BorderStyle.THIN);
        setBorder13.setBorderRight(BorderStyle.THIN);
        setBorder13.setFont(font);
        map.put(13, setBorder13);

        return map;
    }

    /**
     * 问责
     *
     * @param xssfWorkbook
     * @param font
     * @return
     */
    public static Map<Integer, XSSFCellStyle> accountabilityStyle(XSSFWorkbook xssfWorkbook, XSSFFont font) {
        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder1 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(false);
        setBorder1.setWrapText(true);
        setBorder1.setAlignment(HorizontalAlignment.CENTER);
        setBorder1.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder1.setBorderBottom(BorderStyle.THIN);
        setBorder1.setBorderLeft(BorderStyle.THIN);
        setBorder1.setBorderTop(BorderStyle.THIN);
        setBorder1.setBorderRight(BorderStyle.THIN);
        setBorder1.setFont(font);
        map.put(1, setBorder1);

        XSSFCellStyle setBorder2 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(false);
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.LEFT);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        setBorder2.setFont(font);
        map.put(2, setBorder2);

        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 48);
        font.setBold(true);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        map.put(3, setBorder3);

        XSSFCellStyle setBorder4 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder4.setWrapText(true);
        setBorder4.setAlignment(HorizontalAlignment.CENTER);
        setBorder4.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder4.setBorderBottom(BorderStyle.THIN);
        setBorder4.setBorderLeft(BorderStyle.THIN);
        setBorder4.setBorderTop(BorderStyle.THIN);
        setBorder4.setBorderRight(BorderStyle.THIN);
        setBorder4.setFont(font);
        map.put(4, setBorder4);


        XSSFCellStyle setBorder5 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder5.setWrapText(true);
        setBorder5.setAlignment(HorizontalAlignment.LEFT);
        setBorder5.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder5.setBorderBottom(BorderStyle.THIN);
        setBorder5.setBorderLeft(BorderStyle.THIN);
        setBorder5.setBorderTop(BorderStyle.THIN);
        setBorder5.setBorderRight(BorderStyle.THIN);
        setBorder5.setFont(font);
        map.put(5, setBorder5);


        XSSFCellStyle setBorder6 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(true);
        setBorder6.setWrapText(true);
        setBorder6.setAlignment(HorizontalAlignment.CENTER);
        setBorder6.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder6.setBorderBottom(BorderStyle.THIN);
        setBorder6.setBorderLeft(BorderStyle.THIN);
        setBorder6.setBorderTop(BorderStyle.THIN);
        setBorder6.setBorderRight(BorderStyle.THIN);
        setBorder6.setFont(font);
        map.put(6, setBorder6);

        XSSFCellStyle setBorder7 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(true);
        setBorder7.setWrapText(true);
        setBorder7.setAlignment(HorizontalAlignment.CENTER);
        setBorder7.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder7.setBorderBottom(BorderStyle.THIN);
        setBorder7.setBorderLeft(BorderStyle.THIN);
        setBorder7.setBorderTop(BorderStyle.THIN);
        setBorder7.setBorderRight(BorderStyle.THIN);
        setBorder7.setFont(font);
        map.put(7, setBorder7);

        XSSFCellStyle setBorder8 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 16);
        font.setBold(true);
        font.setColor(new XSSFColor(Color.red));
        setBorder8.setWrapText(true);
        setBorder8.setAlignment(HorizontalAlignment.CENTER);
        setBorder8.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder8.setBorderBottom(BorderStyle.THIN);
        setBorder8.setBorderLeft(BorderStyle.THIN);
        setBorder8.setBorderTop(BorderStyle.THIN);
        setBorder8.setBorderRight(BorderStyle.THIN);
        setBorder8.setFont(font);
        map.put(8, setBorder8);

        return map;
    }

    /**
     * 重点工作任务2
     *
     * @param xssfWorkbook
     * @param font
     * @return
     */
    public static Map<Integer, XSSFCellStyle> KeyWorkStyle(XSSFWorkbook xssfWorkbook, XSSFFont font) {

        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder0 = xssfWorkbook.createCellStyle();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder0.setWrapText(true);
        setBorder0.setAlignment(HorizontalAlignment.CENTER);
        setBorder0.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder0.setBorderBottom(BorderStyle.THIN);
        setBorder0.setBorderLeft(BorderStyle.THIN);
        setBorder0.setBorderTop(BorderStyle.THIN);
        setBorder0.setBorderRight(BorderStyle.THIN);
        setBorder0.setFont(font);
        map.put(0, setBorder0);

        XSSFCellStyle setBorder1 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        font.setColor(new XSSFColor(Color.RED));
        setBorder1.setWrapText(true);
        setBorder1.setAlignment(HorizontalAlignment.CENTER);
        setBorder1.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder1.setBorderBottom(BorderStyle.THIN);
        setBorder1.setBorderLeft(BorderStyle.THIN);
        setBorder1.setBorderTop(BorderStyle.THIN);
        setBorder1.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df = xssfWorkbook.createDataFormat();
        setBorder1.setDataFormat(df.getFormat("#,#0.00"));
        setBorder1.setFont(font);
        map.put(1, setBorder1);

        XSSFCellStyle setBorder2 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder2.setWrapText(true);
        setBorder2.setAlignment(HorizontalAlignment.CENTER);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df2 = xssfWorkbook.createDataFormat();
        setBorder2.setDataFormat(df2.getFormat("#,#0.00"));
        setBorder2.setFont(font);
        map.put(2, setBorder2);

        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder3.setWrapText(true);
        setBorder3.setAlignment(HorizontalAlignment.CENTER);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df3 = xssfWorkbook.createDataFormat();
        setBorder3.setDataFormat(df3.getFormat("#,#0.0"));
        setBorder3.setFont(font);
        map.put(3, setBorder3);

        XSSFCellStyle setBorder4 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder4.setWrapText(true);
        setBorder4.setAlignment(HorizontalAlignment.CENTER);
        setBorder4.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder4.setBorderBottom(BorderStyle.THIN);
        setBorder4.setBorderLeft(BorderStyle.THIN);
        setBorder4.setBorderTop(BorderStyle.THIN);
        setBorder4.setBorderRight(BorderStyle.THIN);
        setBorder4.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder4.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df4 = xssfWorkbook.createDataFormat();
        setBorder4.setDataFormat(df4.getFormat("#,#0.0"));
        setBorder4.setFont(font);
        map.put(4, setBorder4);

        XSSFCellStyle setBorder5 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder5.setWrapText(true);
        setBorder5.setAlignment(HorizontalAlignment.CENTER);
        setBorder5.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder5.setBorderBottom(BorderStyle.THIN);
        setBorder5.setBorderLeft(BorderStyle.THIN);
        setBorder5.setBorderTop(BorderStyle.THIN);
        setBorder5.setBorderRight(BorderStyle.THIN);
        setBorder5.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder5.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df5 = xssfWorkbook.createDataFormat();
        setBorder5.setDataFormat(df5.getFormat("#,#0.0"));
        setBorder5.setFont(font);
        map.put(5, setBorder5);

        XSSFCellStyle setBorder6 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder6.setWrapText(true);
        setBorder6.setAlignment(HorizontalAlignment.CENTER);
        setBorder6.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder6.setBorderBottom(BorderStyle.THIN);
        setBorder6.setBorderLeft(BorderStyle.THIN);
        setBorder6.setBorderTop(BorderStyle.THIN);
        setBorder6.setBorderRight(BorderStyle.THIN);
        setBorder6.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder6.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df6 = xssfWorkbook.createDataFormat();
        setBorder6.setDataFormat(df6.getFormat("#,#0.00"));
        setBorder6.setFont(font);
        map.put(6, setBorder6);

        XSSFCellStyle setBorder7 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder7.setWrapText(true);
        setBorder7.setAlignment(HorizontalAlignment.CENTER);
        setBorder7.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder7.setBorderBottom(BorderStyle.THIN);
        setBorder7.setBorderLeft(BorderStyle.THIN);
        setBorder7.setBorderTop(BorderStyle.THIN);
        setBorder7.setBorderRight(BorderStyle.THIN);
        setBorder7.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder7.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df7 = xssfWorkbook.createDataFormat();
        setBorder7.setDataFormat(df7.getFormat("#,#0.00"));
        setBorder7.setFont(font);
        map.put(7, setBorder7);

        XSSFCellStyle setBorder8 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder8.setWrapText(true);
        setBorder8.setAlignment(HorizontalAlignment.CENTER);
        setBorder8.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder8.setBorderBottom(BorderStyle.THIN);
        setBorder8.setBorderLeft(BorderStyle.THIN);
        setBorder8.setBorderTop(BorderStyle.THIN);
        setBorder8.setBorderRight(BorderStyle.THIN);
        setBorder8.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder8.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df8 = xssfWorkbook.createDataFormat();
        setBorder8.setDataFormat(df8.getFormat("#,#0"));
        setBorder8.setFont(font);
        map.put(8, setBorder8);

        XSSFCellStyle setBorder9 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        setBorder9.setWrapText(true);
        setBorder9.setAlignment(HorizontalAlignment.CENTER);
        setBorder9.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder9.setBorderBottom(BorderStyle.THIN);
        setBorder9.setBorderLeft(BorderStyle.THIN);
        setBorder9.setBorderTop(BorderStyle.THIN);
        setBorder9.setBorderRight(BorderStyle.THIN);
        setBorder9.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder9.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df9 = xssfWorkbook.createDataFormat();
        setBorder9.setDataFormat(df9.getFormat("#,#0"));
        setBorder9.setFont(font);
        map.put(9, setBorder9);
        return map;
    }

    /**
     * 重点工作任务2
     *
     * @param xssfWorkbook
     * @param font
     * @return
     */
    public static Map<Integer, XSSFCellStyle> KeyWorkStyleXin(XSSFWorkbook xssfWorkbook, XSSFFont font) {

        Map<Integer, XSSFCellStyle> map = new HashMap<>();

        XSSFCellStyle setBorder0 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setBold(true);
        font.setFontHeightInPoints((short) 14);
        setBorder0.setAlignment(HorizontalAlignment.CENTER);
        setBorder0.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder0.setBorderBottom(BorderStyle.THIN);
        setBorder0.setBorderLeft(BorderStyle.THIN);
        setBorder0.setBorderTop(BorderStyle.THIN);
        setBorder0.setBorderRight(BorderStyle.THIN);
        setBorder0.setFont(font);
        map.put(0, setBorder0);

        XSSFCellStyle setBorder1 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setBold(true);
        font.setFontHeightInPoints((short) 10);
        setBorder1.setAlignment(HorizontalAlignment.CENTER);
        setBorder1.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder1.setBorderBottom(BorderStyle.THIN);
        setBorder1.setBorderLeft(BorderStyle.THIN);
        setBorder1.setBorderTop(BorderStyle.THIN);
        setBorder1.setBorderRight(BorderStyle.THIN);
        setBorder1.setFont(font);
        map.put(1, setBorder1);

        XSSFCellStyle setBorder2 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder2.setAlignment(HorizontalAlignment.CENTER);
        setBorder2.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder2.setBorderBottom(BorderStyle.THIN);
        setBorder2.setBorderLeft(BorderStyle.THIN);
        setBorder2.setBorderTop(BorderStyle.THIN);
        setBorder2.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df2 = xssfWorkbook.createDataFormat();
        setBorder2.setDataFormat(df2.getFormat("0.0"));
        setBorder2.setFont(font);
        map.put(2, setBorder2);

        XSSFCellStyle setBorder3 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder3.setAlignment(HorizontalAlignment.LEFT);
        setBorder3.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder3.setBorderBottom(BorderStyle.THIN);
        setBorder3.setBorderLeft(BorderStyle.THIN);
        setBorder3.setBorderTop(BorderStyle.THIN);
        setBorder3.setBorderRight(BorderStyle.THIN);
        setBorder3.setFont(font);
        map.put(3, setBorder3);

        XSSFCellStyle setBorder4 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(true);
        font.setColor(new XSSFColor(Color.RED));
        setBorder4.setAlignment(HorizontalAlignment.CENTER);
        setBorder4.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder4.setBorderBottom(BorderStyle.THIN);
        setBorder4.setBorderLeft(BorderStyle.THIN);
        setBorder4.setBorderTop(BorderStyle.THIN);
        setBorder4.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df4 = xssfWorkbook.createDataFormat();
        setBorder4.setDataFormat(df4.getFormat("0.00"));
        setBorder4.setFont(font);
        map.put(4, setBorder4);

        XSSFCellStyle setBorder5 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder5.setAlignment(HorizontalAlignment.CENTER);
        setBorder5.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder5.setBorderBottom(BorderStyle.THIN);
        setBorder5.setBorderLeft(BorderStyle.THIN);
        setBorder5.setBorderTop(BorderStyle.THIN);
        setBorder5.setBorderRight(BorderStyle.THIN);
        setBorder5.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder5.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df5 = xssfWorkbook.createDataFormat();
        setBorder5.setDataFormat(df5.getFormat("0.0"));
        setBorder5.setFont(font);
        map.put(5, setBorder5);

        XSSFCellStyle setBorder6 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder6.setAlignment(HorizontalAlignment.CENTER);
        setBorder6.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder6.setBorderBottom(BorderStyle.THIN);
        setBorder6.setBorderLeft(BorderStyle.THIN);
        setBorder6.setBorderTop(BorderStyle.THIN);
        setBorder6.setBorderRight(BorderStyle.THIN);
        setBorder6.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder6.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df6 = xssfWorkbook.createDataFormat();
        setBorder6.setDataFormat(df6.getFormat("0.0"));
        setBorder6.setFont(font);
        map.put(6, setBorder6);

        XSSFCellStyle setBorder7 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder7.setAlignment(HorizontalAlignment.CENTER);
        setBorder7.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder7.setBorderBottom(BorderStyle.THIN);
        setBorder7.setBorderLeft(BorderStyle.THIN);
        setBorder7.setBorderTop(BorderStyle.THIN);
        setBorder7.setBorderRight(BorderStyle.THIN);
        setBorder7.setFont(font);
        map.put(7, setBorder7);

        XSSFCellStyle setBorder8 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder8.setAlignment(HorizontalAlignment.CENTER);
        setBorder8.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder8.setBorderBottom(BorderStyle.THIN);
        setBorder8.setBorderLeft(BorderStyle.THIN);
        setBorder8.setBorderTop(BorderStyle.THIN);
        setBorder8.setBorderRight(BorderStyle.THIN);
        setBorder8.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder8.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        setBorder8.setFont(font);
        map.put(8, setBorder8);

        XSSFCellStyle setBorder9 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder9.setAlignment(HorizontalAlignment.CENTER);
        setBorder9.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder9.setBorderBottom(BorderStyle.THIN);
        setBorder9.setBorderLeft(BorderStyle.THIN);
        setBorder9.setBorderTop(BorderStyle.THIN);
        setBorder9.setBorderRight(BorderStyle.THIN);
        setBorder9.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder9.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        setBorder9.setFont(font);
        map.put(9, setBorder9);

        XSSFCellStyle setBorder10 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder10.setAlignment(HorizontalAlignment.CENTER);
        setBorder10.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder10.setBorderBottom(BorderStyle.THIN);
        setBorder10.setBorderLeft(BorderStyle.THIN);
        setBorder10.setBorderTop(BorderStyle.THIN);
        setBorder10.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df10 = xssfWorkbook.createDataFormat();
        setBorder10.setDataFormat(df10.getFormat("0.00"));
        setBorder10.setFont(font);
        map.put(10, setBorder10);

        XSSFCellStyle setBorder11 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder11.setAlignment(HorizontalAlignment.CENTER);
        setBorder11.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder11.setBorderBottom(BorderStyle.THIN);
        setBorder11.setBorderLeft(BorderStyle.THIN);
        setBorder11.setBorderTop(BorderStyle.THIN);
        setBorder11.setBorderRight(BorderStyle.THIN);
        setBorder11.setFont(font);
        map.put(11, setBorder11);

        XSSFCellStyle setBorder12 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder12.setAlignment(HorizontalAlignment.CENTER);
        setBorder12.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder12.setBorderBottom(BorderStyle.THIN);
        setBorder12.setBorderLeft(BorderStyle.THIN);
        setBorder12.setBorderTop(BorderStyle.THIN);
        setBorder12.setBorderRight(BorderStyle.THIN);
        setBorder12.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder12.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df12 = xssfWorkbook.createDataFormat();
        setBorder12.setDataFormat(df12.getFormat("0.00"));
        setBorder12.setFont(font);
        map.put(12, setBorder12);

        XSSFCellStyle setBorder13 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder13.setAlignment(HorizontalAlignment.CENTER);
        setBorder13.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder13.setBorderBottom(BorderStyle.THIN);
        setBorder13.setBorderLeft(BorderStyle.THIN);
        setBorder13.setBorderTop(BorderStyle.THIN);
        setBorder13.setBorderRight(BorderStyle.THIN);
        setBorder13.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder13.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df13 = xssfWorkbook.createDataFormat();
        setBorder13.setDataFormat(df13.getFormat("0.00"));
        setBorder13.setFont(font);
        map.put(13, setBorder13);

        XSSFCellStyle setBorder14 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder14.setAlignment(HorizontalAlignment.CENTER);
        setBorder14.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder14.setBorderBottom(BorderStyle.THIN);
        setBorder14.setBorderLeft(BorderStyle.THIN);
        setBorder14.setBorderTop(BorderStyle.THIN);
        setBorder14.setBorderRight(BorderStyle.THIN);
        setBorder14.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder14.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df14 = xssfWorkbook.createDataFormat();
        setBorder14.setDataFormat(df14.getFormat("0.000"));
        setBorder14.setFont(font);
        map.put(14, setBorder14);

        XSSFCellStyle setBorder15 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder15.setAlignment(HorizontalAlignment.CENTER);
        setBorder15.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder15.setBorderBottom(BorderStyle.THIN);
        setBorder15.setBorderLeft(BorderStyle.THIN);
        setBorder15.setBorderTop(BorderStyle.THIN);
        setBorder15.setBorderRight(BorderStyle.THIN);
        setBorder15.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder15.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df15 = xssfWorkbook.createDataFormat();
        setBorder15.setDataFormat(df15.getFormat("0.000"));
        setBorder15.setFont(font);
        map.put(15, setBorder15);


        XSSFCellStyle setBorder16 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder16.setAlignment(HorizontalAlignment.CENTER);
        setBorder16.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder16.setBorderBottom(BorderStyle.THIN);
        setBorder16.setBorderLeft(BorderStyle.THIN);
        setBorder16.setBorderTop(BorderStyle.THIN);
        setBorder16.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df16 = xssfWorkbook.createDataFormat();
        setBorder16.setDataFormat(df16.getFormat("0.000"));
        setBorder16.setFont(font);
        map.put(16, setBorder16);


        XSSFCellStyle setBorder17 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder17.setAlignment(HorizontalAlignment.CENTER);
        setBorder17.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder17.setBorderBottom(BorderStyle.THIN);
        setBorder17.setBorderLeft(BorderStyle.THIN);
        setBorder17.setBorderTop(BorderStyle.THIN);
        setBorder17.setBorderRight(BorderStyle.THIN);
        setBorder17.setFillForegroundColor(new XSSFColor(new Color(244, 176, 132)));
        setBorder17.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df17 = xssfWorkbook.createDataFormat();
        setBorder17.setDataFormat(df17.getFormat("0.000"));
        setBorder17.setFont(font);
        map.put(17, setBorder17);

        XSSFCellStyle setBorder18 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder18.setAlignment(HorizontalAlignment.CENTER);
        setBorder18.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder18.setBorderBottom(BorderStyle.THIN);
        setBorder18.setBorderLeft(BorderStyle.THIN);
        setBorder18.setBorderTop(BorderStyle.THIN);
        setBorder18.setBorderRight(BorderStyle.THIN);
        setBorder18.setFillForegroundColor(new XSSFColor(new Color(169, 208, 142)));
        setBorder18.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        XSSFDataFormat df18 = xssfWorkbook.createDataFormat();
        setBorder18.setDataFormat(df18.getFormat("0.000"));
        setBorder18.setFont(font);
        map.put(18, setBorder18);

        XSSFCellStyle setBorder19 = xssfWorkbook.createCellStyle();
        font = xssfWorkbook.createFont();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        font.setBold(false);
        setBorder19.setAlignment(HorizontalAlignment.CENTER);
        setBorder19.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder19.setBorderBottom(BorderStyle.THIN);
        setBorder19.setBorderLeft(BorderStyle.THIN);
        setBorder19.setBorderTop(BorderStyle.THIN);
        setBorder19.setBorderRight(BorderStyle.THIN);
        XSSFDataFormat df19 = xssfWorkbook.createDataFormat();
        setBorder19.setDataFormat(df19.getFormat("0.000"));
        setBorder19.setFont(font);
        map.put(19, setBorder19);

        return map;
    }

    public static Map<Integer, XSSFCellStyle> indexStyle(XSSFWorkbook xssfWorkbook, XSSFFont font) {
        Map<Integer, XSSFCellStyle> map = new HashMap<>();
        XSSFCellStyle setBorder = xssfWorkbook.createCellStyle();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        setBorder.setWrapText(true);
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        map.put(0, setBorder);

        XSSFCellStyle setBorder1 = xssfWorkbook.createCellStyle();
        font.setFontName("宋体");
        font.setFontHeightInPoints((short) 10);
        setBorder1.setWrapText(true);
        setBorder1.setAlignment(HorizontalAlignment.LEFT);
        setBorder1.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder1.setBorderBottom(BorderStyle.THIN);
        setBorder1.setBorderLeft(BorderStyle.THIN);
        setBorder1.setBorderTop(BorderStyle.THIN);
        setBorder1.setBorderRight(BorderStyle.THIN);
        setBorder1.setFont(font);
        map.put(1, setBorder1);
        return map;
    }


    /**
     * 通用下载 xls
     */
    public static void commonDownload(HttpServletRequest request, HttpServletResponse response, HSSFWorkbook hssfWorkbook, String fileName) {
        String userAgent = request.getHeader("User-agent");
        byte[] bytes = userAgent.contains("MSIE") ? fileName.getBytes() : fileName.getBytes(StandardCharsets.UTF_8);
        fileName = new String(bytes, StandardCharsets.ISO_8859_1);
        response.reset();
        response.addHeader("Content-Disposition", String.format("attachment; filename=\"%s\"", fileName));
        try (OutputStream outputStream = response.getOutputStream()) {
            hssfWorkbook.write(outputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 通用下载 xlsx
     */
    public static void commonDownload(HttpServletRequest request, HttpServletResponse response, XSSFWorkbook xssfWorkbook, String fileName) {
        String userAgent = request.getHeader("User-agent");
        byte[] bytes = userAgent.contains("MSIE") ? fileName.getBytes() : fileName.getBytes(StandardCharsets.UTF_8);
        fileName = new String(bytes, StandardCharsets.ISO_8859_1);
        response.reset();
        response.addHeader("Content-Disposition", String.format("attachment; filename=\"%s\"", fileName));
        try (OutputStream outputStream = response.getOutputStream()) {
            xssfWorkbook.write(outputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void commonDownload(HttpServletRequest request, HttpServletResponse response, Workbook workbook, String fileName) {
        String userAgent = request.getHeader("User-agent");
        byte[] bytes = userAgent.contains("MSIE") ? fileName.getBytes() : fileName.getBytes(StandardCharsets.UTF_8);
        fileName = new String(bytes, StandardCharsets.ISO_8859_1);
        response.reset();
        response.addHeader("Content-Disposition", String.format("attachment; filename=\"%s\"", fileName));
        try (OutputStream outputStream = response.getOutputStream()) {
            workbook.write(outputStream);
            workbook.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void commonDownload(HttpServletResponse response, String path, String fileName) {
        try {
            // 读到流中
            InputStream inStream = new FileInputStream(path);// 文件的存放路径
            // 设置输出的格式
            response.reset();
            response.setContentType("bin");
            response.setHeader("Content-Disposition",
                    "attachment;filename=" + new String(fileName.getBytes("GBK"), "ISO8859-1"));
            // 循环取出流中的数据
            byte[] b = new byte[100];
            int len;
            try {
                while ((len = inStream.read(b)) > 0) {
                    response.getOutputStream().write(b, 0, len);
                }
                inStream.close();

                //下载完成之后，删掉这个zip包
                File fileTempZip = new File(path);
                fileTempZip.delete();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
        }
    }

    public static Map<Integer, HSSFCellStyle> indexStyleRed(HSSFWorkbook hssfWorkbook, HSSFFont font) {
        Map<Integer, HSSFCellStyle> styleMap = new HashMap<>();
        font.setFontName("仿宋_GB2312");
        font.setFontHeightInPoints((short) 10);
        HSSFCellStyle setBorder = hssfWorkbook.createCellStyle();
        setBorder.setAlignment(HorizontalAlignment.CENTER);
        setBorder.setVerticalAlignment(VerticalAlignment.CENTER);
        setBorder.setBorderBottom(BorderStyle.THIN);
        setBorder.setBorderLeft(BorderStyle.THIN);
        setBorder.setBorderTop(BorderStyle.THIN);
        setBorder.setBorderRight(BorderStyle.THIN);
        setBorder.setFont(font);
        setBorder.setWrapText(true);
        setBorder.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
        setBorder.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        styleMap.put(0, setBorder);
        return styleMap;
    }
}